Auto merge of #4649 - jongiddy:gitignore-newline, r=alexcrichton
authorbors <bors@rust-lang.org>
Wed, 25 Oct 2017 06:42:27 +0000 (06:42 +0000)
committerbors <bors@rust-lang.org>
Wed, 25 Oct 2017 06:42:27 +0000 (06:42 +0000)
commit5b0865ed5dab9ccb3da7eb0614788fc4ffd43a71
tree7ec6638ec6f1cb6f372f7065813001e078d27264
parentd5b7d5cafb1d81be22b314c702c7cbe2568c954a
parentbaf7770f8fdd39841460c76f9f6e2196e62b7919
Auto merge of #4649 - jongiddy:gitignore-newline, r=alexcrichton

Add a newline before appended VCS ignore lines

The `cargo init` command appends to `.gitignore` or `.hgignore` without checking if the last line of the existing file ends with a newline.

This change will insert a newline before the appended lines. If the last line has no newline, this will ensure the lines are kept separated. If the newline is present, this will insert a blank line. Both Git and Mercurial ignore blank lines in these files.